<template>
  <dl>
    <dt>名称</dt>
    <dd class="m1">
      <BaseText :err="err" @inputValue="onInputValue" :value="name"/>
    </dd>
  </dl>
</template>

<script>
import dataApi from '@/view/v/data-api'
import BaseText from '@/view/comm/BaseText'
export default {
  components: {
    BaseText
  },
  computed: {
    err () {
      return this.name.length > 20
    },
    name () {
      return dataApi.core.name
    }
  },
  methods: {
    onInputValue (v) {
      dataApi.core.name = v
    }
  }
}
</script>
